Image Stitching
   HOME

TheInfoList



OR:

Image stitching or photo stitching is the process of combining multiple
photograph A photograph (also known as a photo, image, or picture) is an image created by light falling on a photosensitive surface, usually photographic film or an electronic image sensor, such as a CCD or a CMOS chip. Most photographs are now create ...
ic
image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensiona ...
s with overlapping fields of view to produce a segmented
panorama A panorama (formed from Greek πᾶν "all" + ὅραμα "view") is any wide-angle view or representation of a physical space, whether in painting, drawing, photography, film, seismic images, or 3D modeling. The word was originally coined in ...
or high-resolution image. Commonly performed through the use of
computer software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
, most approaches to image stitching require nearly exact overlaps between images and identical exposures to produce seamless results, although some stitching algorithms actually benefit from differently exposed images by doing
high-dynamic-range imaging In photography and videography, multi-exposure HDR capture is a technique that creates extended or high dynamic range (HDR) images by taking and combining multiple exposures of the same subject matter at different exposure levels. Combining mu ...
in regions of overlap. Some
digital camera A digital camera is a camera that captures photographs in digital memory. Most cameras produced today are digital, largely replacing those that capture images on photographic film. Digital cameras are now widely incorporated into mobile device ...
s can stitch their photos internally.


Applications

Image stitching is widely used in modern applications, such as the following: * Document mosaicing *
Image stabilization Image stabilization (IS) is a family of techniques that reduce blurring associated with the motion of a camera or other imaging device during exposure. Generally, it compensates for pan and tilt (angular movement, equivalent to yaw and pit ...
feature in camcorders that use frame-rate image alignment *High-resolution photomosaics in digital maps and satellite imagery *
Medical imaging Medical imaging is the technique and process of imaging the interior of a body for clinical analysis and medical intervention, as well as visual representation of the function of some organs or tissues (physiology). Medical imaging seeks to rev ...
*Multiple-image super-resolution imaging *Video stitching *Object insertion


Process

The image stitching process can be divided into three main components: ''image registration'', ''calibration'', and ''blending''.


Image stitching algorithms

In order to estimate image alignment, algorithms are needed to determine the appropriate mathematical model relating pixel coordinates in one image to pixel coordinates in another. Algorithms that combine direct pixel-to-pixel comparisons with gradient descent (and other optimization techniques) can be used to estimate these parameters. Distinctive features can be found in each image and then efficiently matched to rapidly establish
correspondences Correspondence may refer to: *In general usage, non-concurrent, remote communication between people, including letters, email, newsgroups, Internet forums, blogs. Science * Correspondence principle (physics): quantum physics theories must agree ...
between pairs of images. When multiple images exist in a panorama, techniques have been developed to compute a globally consistent set of alignments and to efficiently discover which images overlap one another. A final compositing surface onto which to warp or projectively transform and place all of the aligned images is needed, as are algorithms to seamlessly blend the overlapping images, even in the presence of parallax, lens distortion, scene motion, and exposure differences.


Image stitching issues

Since the illumination in two views cannot be guaranteed to be identical, stitching two images could create a visible seam. Other reasons for seams could be the background changing between two images for the same continuous foreground. Other major issues to deal with are the presence of
parallax Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight and is measured by the angle or semi-angle of inclination between those two lines. Due to foreshortening, nearby objects ...
, lens distortion, scene
motion In physics, motion is the phenomenon in which an object changes its position with respect to time. Motion is mathematically described in terms of displacement, distance, velocity, acceleration, speed and frame of reference to an observer and mea ...
, and exposure differences. In a non-ideal real-life case, the intensity varies across the whole scene, and so does the contrast and intensity across frames. Additionally, the aspect ratio of a panorama image needs to be taken into account to create a visually pleasing
composite Composite or compositing may refer to: Materials * Composite material, a material that is made from several different substances ** Metal matrix composite, composed of metal and other parts ** Cermet, a composite of ceramic and metallic materials ...
. For panoramic stitching, the ideal set of images will have a reasonable amount of overlap (at least 15–30%) to overcome lens distortion and have enough detectable features. The set of images will have consistent exposure between frames to minimize the probability of seams occurring.


Keypoint detection

Feature detection is necessary to automatically find correspondences between images. Robust correspondences are required in order to estimate the necessary transformation to align an image with the image it is being composited on. Corners, blobs, Harris corners, and differences of Gaussians of Harris corners are good features since they are repeatable and distinct. One of the first operators for interest point detection was developed by Hans P. Moravec in 1977 for his research involving the automatic navigation of a robot through a clustered environment. Moravec also defined the concept of "points of interest" in an image and concluded these interest points could be used to find matching regions in different images. The Moravec operator is considered to be a corner detector because it defines interest points as points where there are large intensity variations in all directions. This often is the case at corners. However, Moravec was not specifically interested in finding corners, just distinct regions in an image that could be used to register consecutive image frames. Harris and Stephens improved upon Moravec's corner detector by considering the differential of the corner score with respect to direction directly. They needed it as a processing step to build interpretations of a robot's environment based on image sequences. Like Moravec, they needed a method to match corresponding points in consecutive image frames, but were interested in tracking both corners and edges between frames. SIFT and SURF are recent key-point or interest point detector algorithms but a point to note is that SURF is patented and its commercial usage restricted. Once a feature has been detected, a descriptor method like SIFT descriptor can be applied to later match them.


Registration

Image registration Image registration is the process of transforming different sets of data into one coordinate system. Data may be multiple photographs, data from different sensors, times, depths, or viewpoints. It is used in computer vision, medical imaging, milit ...
involves matching features in a set of images or using direct alignment methods to search for image alignments that minimize the
sum of absolute differences In digital image processing, the sum of absolute differences (SAD) is a measure of the similarity between image blocks. It is calculated by taking the absolute difference between each pixel in the original block and the corresponding pixel in the ...
between overlapping pixels. When using direct alignment methods one might first calibrate one's images to get better results. Additionally, users may input a rough model of the panorama to help the feature matching stage, so that e.g. only neighboring images are searched for matching features. Since there are smaller group of features for matching, the result of the search is more accurate and execution of the comparison is faster. To estimate a robust model from the data, a common method used is known as
RANSAC Random sample consensus (RANSAC) is an iterative method to estimate parameters of a mathematical model from a set of observed data that contains outliers, when outliers are to be accorded no influence on the values of the estimates. Therefore, it a ...
. The name RANSAC is an abbreviation for "RANdom SAmple Consensus". It is an iterative method for robust parameter estimation to fit mathematical models from sets of observed data points which may contain outliers. The algorithm is non-deterministic in the sense that it produces a reasonable result only with a certain probability, with this probability increasing as more iterations are performed. It being a probabilistic method means that different results will be obtained for every time the algorithm is run. The RANSAC algorithm has found many applications in computer vision, including the simultaneous solving of the correspondence problem and the estimation of the fundamental matrix related to a pair of stereo cameras. The basic assumption of the method is that the data consists of "inliers", i.e., data whose distribution can be explained by some mathematical model, and "outliers" which are data that do not fit the model. Outliers are considered points which come from noise, erroneous measurements, or simply incorrect data. For the problem of
homography In projective geometry, a homography is an isomorphism of projective spaces, induced by an isomorphism of the vector spaces from which the projective spaces derive. It is a bijection that maps lines to lines, and thus a collineation. In general, ...
estimation, RANSAC works by trying to fit several models using some of the point pairs and then checking if the models were able to relate most of the points. The best model – the homography, which produces the highest number of correct matches – is then chosen as the answer for the problem; thus, if the ratio of number of outliers to data points is very low, the RANSAC outputs a decent model fitting the data.


Calibration

''Image calibration'' aims to minimize differences between an ideal lens models and the camera-lens combination that was used, optical defects such as
distortions In signal processing, distortion is the alteration of the original shape (or other characteristic) of a signal. In communications and electronics it means the alteration of the waveform of an information-bearing signal, such as an audio signa ...
, exposure differences between images,
vignetting In photography and optics, vignetting is a reduction of an image's brightness or saturation toward the periphery compared to the image center. The word ''vignette'', from the same root as ''vine'', originally referred to a decorative border ...
, camera response and
chromatic aberration In optics, chromatic aberration (CA), also called chromatic distortion and spherochromatism, is a failure of a lens to focus all colors to the same point. It is caused by dispersion: the refractive index of the lens elements varies with the wave ...
s. If feature detection methods were used to register images and absolute positions of the features were recorded and saved, stitching software may use the data for geometric optimization of the images in addition to placing the images on the panosphere. Panotools and its various derivative programs use this method.


Alignment

Alignment may be necessary to transform an image to match the view point of the image it is being composited with. Alignment, in simple terms, is a change in the coordinates system so that it adopts a new coordinate system which outputs image matching the required viewpoint. The types of transformations an image may go through are pure translation, pure rotation, a similarity transform which includes translation, rotation and scaling of the image which needs to be transformed,
Affine Affine may describe any of various topics concerned with connections or affinities. It may refer to: * Affine, a relative by marriage in law and anthropology * Affine cipher, a special case of the more general substitution cipher * Affine comb ...
or projective transform. Projective transformation is the farthest an image can transform (in the set of two dimensional planar transformations), where only visible features that are preserved in the transformed image are straight lines whereas parallelism is maintained in an affine transform. Projective transformation can be mathematically described as :, where x is points in the old coordinate system, x’ is the corresponding points in the transformed image and H is the
homography In projective geometry, a homography is an isomorphism of projective spaces, induced by an isomorphism of the vector spaces from which the projective spaces derive. It is a bijection that maps lines to lines, and thus a collineation. In general, ...
matrix. Expressing the points x and x’ using the camera intrinsics (K and K’) and its rotation and translation to the real-world coordinates X and X’, we get : and . Using the above two equations and the homography relation between x’ and x, we can derive : The homography matrix H has 8 parameters or degrees of freedom. The homography can be computed using Direct Linear Transform and Singular value decomposition with :, where A is the matrix constructed using the coordinates of correspondences and h is the one dimensional vector of the 9 elements of the reshaped homography matrix. To get to h we can simple apply SVD: And h = V (column corresponding to the smallest singular vector). This is true since h lies in the null space of A. Since we have 8 degrees of freedom the algorithm requires at least four point correspondences. In case when RANSAC is used to estimate the homography and multiple correspondences are available the correct homography matrix is the one with the maximum number of inliers.


Compositing

Compositing Compositing is the process or technique of combining visual elements from separate sources into single images, often to create the illusion that all those elements are parts of the same scene. Live-action shooting for compositing is variously ca ...
is the process where the rectified images are aligned in such a way that they appear as a single shot of a scene. Compositing can be automatically done since the algorithm now knows which correspondences overlap.


Blending

''Image blending'' involves executing the adjustments figured out in the calibration stage, combined with remapping of the images to an output projection. Colors are adjusted between images to compensate for exposure differences. If applicable,
high dynamic range High dynamic range (HDR) is a dynamic range higher than usual, synonyms are wide dynamic range, extended dynamic range, expanded dynamic range. The term is often used in discussing the dynamic range of various signals such as images, videos, au ...
merging is done along with
motion compensation Motion compensation in computing, is an algorithmic technique used to predict a frame in a video, given the previous and/or future frames by accounting for motion of the camera and/or objects in the video. It is employed in the encoding of video d ...
and deghosting. Images are blended together and seam line adjustment is done to minimize the visibility of seams between images. The seam can be reduced by a simple gain adjustment. This compensation is basically minimizing intensity difference of overlapping pixels. Image blending algorithm allots more weight to pixels near the center of the image. Gain compensated and multi band blended images compare the best. IJCV 2007. Straightening is another method to rectify the image. Matthew Brown and David G. Lowe in their paper ‘Automatic Panoramic Image Stitching using Invariant Features’ describe methods of straightening which apply a global rotation such that vector u is vertical (in the rendering frame) which effectively removes the wavy effect from output panoramas Even after gain compensation, some image edges are still visible due to a number of unmodelled effects, such as vignetting (intensity decreases towards the edge of the image), parallax effects due to unwanted motion of the optical centre, mis-registration errors due to mismodelling of the camera, radial distortion and so on. Due to these reasons they propose a blending strategy called multi band blending.


Projective layouts

For image segments that have been taken from the same point in space, stitched images can be arranged using one of various
map projection In cartography, map projection is the term used to describe a broad set of transformations employed to represent the two-dimensional curved surface of a globe on a plane. In a map projection, coordinates, often expressed as latitude and longitud ...
s.


Rectilinear

''
Rectilinear projection Rectilinear means related to a straight line; it may refer to: * Rectilinear grid, a tessellation of the Euclidean plane * Rectilinear lens, a photographic lens * Rectilinear locomotion, a form of animal locomotion * Rectilinear polygon, a polygo ...
'', where the stitched image is viewed on a two-dimensional plane intersecting the panosphere in a single point. Lines that are straight in reality are shown as straight regardless of their directions on the image. Wide views - around 120° or so - start to exhibit severe distortion near the image borders. One case of rectilinear projection is the use of ''cube faces'' with cubic mapping for panorama viewing. Panorama is mapped to six squares, each cube face showing 90 by 90 degree area of the panorama.


Cylindrical

''
Cylindrical projection In cartography, map projection is the term used to describe a broad set of transformations employed to represent the two-dimensional curved surface of a globe on a plane. In a map projection, coordinates, often expressed as latitude and longitu ...
'', where the stitched image shows a 360° horizontal field of view and a limited vertical field of view. Panoramas in this projection are meant to be viewed as though the image is wrapped into a cylinder and viewed from within. When viewed on a 2D plane, horizontal lines appear curved while vertical lines remain straight. Vertical distortion increases rapidly when nearing the top of the panosphere. There are various other cylindrical formats, such as
Mercator __NOTOC__ Mercator (Latin for "merchant") may refer to: People * Marius Mercator (c. 390–451), a Catholic ecclesiastical writer * Arnold Mercator, a 16th-century cartographer * Gerardus Mercator, a 16th-century cartographer ** Mercator 1569 ...
and Miller cylindrical which have less distortion near the poles of the panosphere.


Spherical

''Spherical projection'' or ''
equirectangular projection The equirectangular projection (also called the equidistant cylindrical projection or la carte parallélogrammatique projection), and which includes the special case of the plate carrée projection (also called the geographic projection, lat/lon ...
'' — which is strictly speaking another cylindrical projection — where the stitched image shows a 360° horizontal by 180° vertical field of view i.e. the whole sphere. Panoramas in this projection are meant to be viewed as though the image is wrapped into a sphere and viewed from within. When viewed on a 2D plane, horizontal lines appear curved as in a cylindrical projection, while vertical lines remain vertical.


Panini

Since a panorama is basically a map of a sphere, various other mapping projections from
cartographers Cartography (; from grc, χάρτης , "papyrus, sheet of paper, map"; and , "write") is the study and practice of making and using maps. Combining science, aesthetics and technique, cartography builds on the premise that reality (or an i ...
can also be used if so desired. Additionally there are specialized projections which may have more aesthetically pleasing advantages over normal cartography projections such as Hugin's Panini projection - named after Italian vedutismo painter
Giovanni Paolo Panini Giovanni Paolo Panini or Pannini (17 June 1691 – 21 October 1765) was an Italian painter and architect who worked in Rome and is primarily known as one of the ''vedutisti'' ("view painters"). As a painter, Panini is best known for his vistas of ...
- or PTgui's Vedutismo projection. Different projections may be combined in same image for fine tuning the final look of the output image.Tawbaware.com
PTAssembler projections: Hybrid


Stereographic

Stereographic projection In mathematics, a stereographic projection is a perspective projection of the sphere, through a specific point on the sphere (the ''pole'' or ''center of projection''), onto a plane (geometry), plane (the ''projection plane'') perpendicular to ...
or fisheye projection can be used to form a ''little planet'' panorama by pointing the virtual camera straight down and setting the
field of view The field of view (FoV) is the extent of the observable world that is seen at any given moment. In the case of optical instruments or sensors it is a solid angle through which a detector is sensitive to electromagnetic radiation. Humans a ...
large enough to show the whole ground and some of the areas above it; pointing the virtual camera upwards creates a tunnel effect.
Conformality In mathematics, a conformal map is a function that locally preserves angles, but not necessarily lengths. More formally, let U and V be open subsets of \mathbb^n. A function f:U\to V is called conformal (or angle-preserving) at a point u_0\in ...
of the stereographic projection may produce more visually pleasing result than equal area fisheye projection as discussed in the stereo-graphic projection's article.


Artifacts

The use of images not taken from the same place (on a pivot about the
entrance pupil In an optical system, the entrance pupil is the optical image of the physical aperture stop, as 'seen' through the front (the object side) of the lens system. The corresponding image of the aperture as seen through the back of the lens system is ...
of the camera) can lead to
parallax Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight and is measured by the angle or semi-angle of inclination between those two lines. Due to foreshortening, nearby objects ...
errors in the final product. When the captured scene features rapid movement or dynamic motion, artifacts may occur as a result of time differences between the image segments. "Blind stitching" through feature-based alignment methods (see autostitch), as opposed to manual selection and stitching, can cause imperfections in the assembly of the panorama.


Software

Dedicated programs include Autostitch,
Hugin Hugin may refer to: * Bob Hugin (born 1954), American politician and businessman * Hugin (longship), a Danish reconstruction of a Viking longship on display in Ramsgate, England * HUGIN, a widely used tool for uncertain reasoning using Bayesian net ...
, Ptgui,
Panorama Tools Panorama Tools ''(also known as PanoTools)'' are a suite of programs and libraries for image stitching, i.e., re-projecting and blending multiple source images into immersive panoramas of many types. It was originally written by German physics ...
, Microsoft Research Image Composite Editor and CleVR Stitcher. Many other programs can also stitch multiple images; a popular example is
Adobe Systems Adobe Inc. ( ), originally called Adobe Systems Incorporated, is an American multinational computer software company incorporated in Delaware and headquartered in San Jose, California. It has historically specialized in software for the crea ...
'
Photoshop Adobe Photoshop is a raster graphics editor developed and published by Adobe Inc. for Windows and macOS. It was originally created in 1988 by Thomas and John Knoll. Since then, the software has become the industry standard not only in raster ...
, which includes a tool known as ''Photomerge'' and, in the latest versions, the new ''Auto-Blend''. Other programs such as VideoStitch make it possible to stitch videos, and
Vahana VR ''Vahana'' ( sa, वाहन, or animal vehicle, literally "that which carries, that which pulls") denotes the being, typically an animal or mythical, a particular Hindus, Hindu God is said to use as a vehicle. In this capacity, the vahana ...
enables real-time video stitching. Image Stitching module for QuickPHOTO microscope software enables to interactively stitch together multiple fields of view from microscope using camera's live view. It can be also used for manual stitching of whole microscopy samples.


See also

* ActionShot panoramic photography *
Anaglyph 3D Anaglyph 3D is the stereoscopic 3D effect achieved by means of encoding each eye's image using filters of different (usually chromatically opposite) colors, typically red and cyan. Anaglyph 3D images contain two differently filtered colored ...
*
Derivative work In copyright law, a derivative work is an expressive creation that includes major copyrightable elements of an original, previously created first work (the underlying work). The derivative work becomes a second, separate work independent in fo ...
*
Digital image mosaic A digital image is an image composed of picture elements, also known as ''pixels'', each with ''finite'', '' discrete quantities'' of numeric representation for its intensity or gray level that is an output from its two-dimensional functions ...
* Document mosaicing * Panography *
Panoramic photography Panoramic photography is a technique of photography, using specialized equipment or software, that captures images with horizontally elongated fields of view. It is sometimes known as ''wide format photography''. The term has also been applied to ...
*
VR photography VR photography (after virtual-reality photography) is the interactive viewing of panoramic photographs, generally encompassing a 360-degree circle or a spherical view. The results is known as VR photograph (or VR photo), 360-degree photo, phot ...
(interactive panoramas)


References


External links

* {{commons category inline, Stitching Photographic techniques Image processing Applications of computer vision